package com.weberror.frontendmonitoring.portanomaly.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 接口异常(Portanomaly)表实体类
 *
 * @author cnxym
 * @since 2022-08-17 19:18:22
 */
@TableName(value = "portanomaly")
public class Portanomaly {
    //接口异常id
    @TableId(value = "portanomaly_id", type= IdType.AUTO)
    private Integer portanomalyId;
    //接口异常类型
    @TableField(value = "portanomaly_type")
    private String portanomalyType;
    //发生错误的地址
    @TableField(value = "portanomaly_triggerurl")
    private String portanomalyTriggerurl;
    //请求地址
    @TableField(value = "portanomaly_requesturl")
    private String portanomalyRequesturl;
    //请求的参数(post)
    @TableField(value = "portanomaly_params")
    private String portanomalyParams;
    //产生错误时间
    @TableField(value = "portanomaly_time")
    private String portanomalyTime;
    //请求返回代码
    @TableField(value = "portanomaly_responsestatus")
    private Integer portanomalyResponsestatus;
    //返回的信息
    @TableField(value = "portanomaly_errmessage")
    private String portanomalyErrmessage;

    public Integer getPortanomalyId() {
        return portanomalyId;
    }

    public void setPortanomalyId(Integer portanomalyId) {
        this.portanomalyId = portanomalyId;
    }

    public String getPortanomalyType() {
        return portanomalyType;
    }

    public void setPortanomalyType(String portanomalyType) {
        this.portanomalyType = portanomalyType;
    }

    public String getPortanomalyTriggerurl() {
        return portanomalyTriggerurl;
    }

    public void setPortanomalyTriggerurl(String portanomalyTriggerurl) {
        this.portanomalyTriggerurl = portanomalyTriggerurl;
    }

    public String getPortanomalyRequesturl() {
        return portanomalyRequesturl;
    }

    public void setPortanomalyRequesturl(String portanomalyRequesturl) {
        this.portanomalyRequesturl = portanomalyRequesturl;
    }

    public String getPortanomalyParams() {
        return portanomalyParams;
    }

    public void setPortanomalyParams(String portanomalyParams) {
        this.portanomalyParams = portanomalyParams;
    }

    public String getPortanomalyTime() {
        return portanomalyTime;
    }

    public void setPortanomalyTime(Object portanomalyTime) {
        if (portanomalyTime instanceof Date) {
            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            Date date = (Date) portanomalyTime;
            this.portanomalyTime = dateFormat.format(date);
        } else if (portanomalyTime instanceof Long) {
            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            Date date = new Date((Long) portanomalyTime);
            this.portanomalyTime = dateFormat.format(date);
        }
    }

    public Integer getPortanomalyResponsestatus() {
        return portanomalyResponsestatus;
    }

    public void setPortanomalyResponsestatus(Integer portanomalyResponsestatus) {
        this.portanomalyResponsestatus = portanomalyResponsestatus;
    }

    public String getPortanomalyErrmessage() {
        return portanomalyErrmessage;
    }

    public void setPortanomalyErrmessage(String portanomalyErrmessage) {
        this.portanomalyErrmessage = portanomalyErrmessage;
    }
}

